import React from "react";
import Taro from "@tarojs/taro";
import { View } from '@tarojs/components'
import './index.scss'
const Tabs = (props) => {
  const { activeKey, list = [], onChange, classname = '' } = props;
  return (
    <View className={`tab_box ${classname}`}>
      {list.map((item, index) => {
        return (
          <View
            onClick={() => {
              onChange(item.value);
            }}
            key={index}
            className={activeKey === item.value ? 'tab_list_select' : 'tab_list_noSelect'}
          >
            {item.label}
            {activeKey === item.value && <View className="tab_liner"></View>}
          </View>
        );
      })}
    </View>
  );
}
export default Tabs